class Student(object):

    @property #利用@property装饰器来将getter方法变成属性，同时它会创建另一个装饰器@score.setter
    def score(self):
        return self.__score
    
    @score.setter #负责将一个setter方法变成属性赋值
    def score(self,value):
        if not isinstance(value,int):
            raise ValueError('score must be an integer')
        if value<0 or value>100:
            raise ValueError('score must between 0~100!')
        self.__score = value

s = Student()
s.score = 60
s.score